﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户中心</title>
  <{include file="header.html"}>
    <div id="cont">
        <div id="tban">
            <div id="tban_le">
                <div id="tban_le_01">
                    <img src="../../../tpl/images/nlw_dqbg2.jpg" width="10" height="103" />
                </div>
                <div id="tban_le_02">
                    <h1>
                        厦门周边旅游景点
                    </h1>
                    <div id="tban_le_txt">
                        厦门周边旅游景点大全，推荐当季最佳最受欢迎的旅游景点，还有适合周末休闲的好去处。
                    </div>
                </div>
                <div id="tban_le_03">
                    <img src="../../../tpl/images/nlw_dqbg4.jpg" width="10" height="103" />
                </div>
            </div>
            <div id="tban_ri">
                <div id="tban_le_01">
                    <img src="../../../tpl/images/nlw_dqbg2.jpg" width="10" height="103" />
                </div>
                <div id="tban_le_02">
                    <h1>
                        推荐分类
                    </h1>
                    <div id="tban_le_txt" class="tgray1">
                        厦门周边一日游 厦门周边农家乐 厦门有什么好玩的地方
                    </div>
                </div>
                <div id="tban_le_03">
                    <img src="../../../tpl/images/nlw_dqbg4.jpg" width="10" height="103" />
                </div>
            </div>
        </div>
    </div>
    <div id="cont">
        <div id="d_tit06">
            发布游记</div>
        <div id="d_bk_t">
            <div id="d_bk_t01">
                <div class="c1">
                </div>
            </div>
            <div id="d_bk_t02">
                <div class="c1">
                </div>
            </div>
        </div>
        <div id="userinfo_bk">
            <div class="main_content">
                <div class="main_content_left">
                    <img class="user_img" src="<{$avatar}>thumb_01.jpeg" width="200" height="200" />
                    <div class="content_padding tgreen">
                        <{$uname}><span class="tgray1"> <a href="<{spUrl c=ucenter a=UserData}>">- [编辑个人信息]</a></span></div>
                    <div class="content_padding tgray1">
                        钻石:&nbsp;<img src="../../../tpl/images/nlw_ic2.gif" width="16" height="16" align="absmiddle" /><{$integral}></div>
                    <div class="content_padding">
                        <ul>
                            <li><a href="<{spUrl c=ucenter a=UserData}>"><span class="tgreen">- 修改资料</span></a></li>
                            <li><a href="<{spUrl c=ucenter a=UserPass}>">- 修改密码</a></li>
<!--                             <li><a href="#">- 账号关联(QQ 微博)</a><a href="#"></a></li>
                            <li><a href="#">- 我的提醒</a></li>
                            <li><a href="#">- 我的私信</a></li> -->
                            <li><a href="<{spUrl c=ucenter a=UserTest}>">- 我的测试</a></li>
                        </ul>
                    </div>
                </div>
                <div class="main_content_right">
                    <ul class="menu">
                        <li><a href="<{spUrl c=ucenter a=index}>">个人中心</a></li>
                        <li><a href="<{spUrl c=ucenter a=UserAnswers}>">发帖</a></li>
                        <li><a href="<{spUrl c=ucenter a=UserYouji}>">游记</a></li>
                        <li><a href="<{spUrl c=ucenter a=UserComment}>">点评</a></li>
<!--                         <li><a href="#">想去</a></li>
                        <li><a href="#">去过</a></li>
                        <li><a href="#">评分</a></li> -->
                        <li><a href="<{spUrl c=ucenter a=UserPicture}>">照片</a></li>
                        <li><a href="<{spUrl c=ucenter a=UserLog}>">动态</a></li>
                    </ul>
                    <div class="content_ara">
                       <!-- 表格 -->
                          <div style="padding-bottom:20px;">
                              <div class="bbs_us01_2">
                              <div class="bbs_us02_2">主题</div>
                              <div class="bbs_us04_2">回复/浏览</div>
                              <div class="bbs_us04_2">时间</div>
                          </div>

                          <{foreach item=youjiinfoout from=$youjiinfo key=enname}>
                            <{if $enname == '0'}>
                           <div class="bbs_us03_2">
                              <div class="bbs_us02_2"><span class="tgreen">[<a target="_blank" href="<{spUrl}>scenery/<{$scenerys[$enname]['id']}>.html"><{$scenerys[$enname]['title']}></a>]</span> <a target="_blank" title="<{$youjiinfoout.title|truncate:14:"...":true}>" href="<{spUrl}>youji/info/<{$youjiinfoout.id}>.html"><{$youjiinfoout.title|truncate:14:"...":true}></a> </div>
                              <div class="bbs_us04_2 tgray1">3/189</div>
                              <div class="bbs_us04_2 tgray1"><{$youjiinfoout.releasedate|date_format:"%Y-%m-%d"}></div>
                           </div>  
                            <{else}>
                          <div class="bbs_us05_2">
                              <div class="bbs_us02_2"><span class="tgreen">[<a target="_blank" href="<{spUrl}>scenery/<{$scenerys[$enname]['id']}>.html"><{$scenerys[$enname]['title']}></a>]</span> <a target="_blank" title="<{$youjiinfoout.title|truncate:14:"...":true}>" href="<{spUrl}>youji/info/<{$youjiinfoout.id}>.html"><{$youjiinfoout.title|truncate:14:"...":true}></a> </div>
                              <div class="bbs_us04_2 tgray1">3/189</div>
                              <div class="bbs_us04_2 tgray1"><{$youjiinfoout.releasedate|date_format:"%Y-%m-%d"}></div>
                           </div>  
                            <{/if}>
                         <{/foreach}>
                         </div>
                       <!-- 表格 -->
                        <{if $pager.total_page!=""}>
                            <div style="margin-top:10px;" class="nl_page">
                              <div class="nl_page01">当前<{$pager.current_page}>/<{$pager.total_page}> 页</div>
                                <{if $pager.current_page!=1}>
                                <div class="nl_page02"><a href="<{spUrl c=ucenter a=UserYouji page=$pager.prev_page}>">上一页</a></div>
                                <{/if}>
                                <{if $pager.current_page!=$pager.total_page}>
                              <div class="nl_page02"><a href="<{spUrl c=ucenter a=UserYouji page=$pager.next_page}>">下一页</a></div>
                                <{/if}>
                          <{/if}>
                    </div>
                </div>
            </div>
        </div>
        <div id="d_bk_b">
            <div id="d_bk_b01">
                <div class="c1">
                </div>
            </div>
            <div id="d_bk_b02">
                <div class="c1">
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../tpl/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
<!--  
function hotkey()  
{  
  var a=window.event.keyCode;  
  if(a==13)  
  {  
    updata();
  }  
  }// end hotkey  
  document.onkeydown = hotkey; //当onkeydown 事件发生时调用hotkey函数  
  </script>
<style>
 .input-xlarge{ height:32px;}
</style>
<script type="text/javascript">
$(document).ready(function(){ // 当页面加载完毕的时候
  // 例子三
  $("#ex3button").click(function(){ // “提交”按钮被点击
    // 构造发送的数据，请注意如果获取表单各项的值
      updata();
  });
});

function updata(){

    var formdata = {
      'uname' : $('#uname').val(),
      'oldPass' : $('#oldPass').val(),
      'checkPass' : $('#checkPass').val(),
      'Password' : $('#Password').val(),
      'realname' : $('#realname').val(),
      'Phone' : $('#Phone').val(),
      'QQ' : $('#QQ').val(),
      'Email' : $('#Email').val(),
      'Address' : $('#Address').val(),
      'provinceid' : $('#provinceid').val(),
      'cityid' : $('#cityid').val(),
      'areaid' : $('#areaid').val(),
      'id' : $('#id').val()
    };
    var id  = $('#id').val();  // 根据有没有id 判断是编辑还是增加
    if(id == '')
    {
      // 用$.post发送数据
      $.post('<{spUrl c=ucenter a=adddata}>', formdata, function(result){
        $('#resulttable').append(result); // 返回的数据直接追加到resulttable表格的后面
         feedback(result,"reg");
      });
    }
    else
    {
        // 用$.post发送数据
      $.post('<{spUrl c=ucenter a=editdata}>', formdata, function(result){
        $('#resulttable').append(result); // 返回的数据直接追加到resulttable表格的后面
         feedback(result,id);
      }); 
    }
}

function del(id){
    $.get('<{spUrl c=ucenter a=deldata}>', 'id='+id, function(result){
      $('#ex1result').html(result); // 返回的数据直接显示在id=ex1result的span中。
      window.location.reload();
    });
}

// 分类列出
function province(id){
  if(id.value != 0)
  {
    var formdata = {
      'id' : id.value
    };
    $.post('<{spUrl c=ucenter a=subclass}>', formdata, function(result){
      $('#resulttable').append(result);
      //alert(result);
      $("#cityid option").remove();
      var response = eval("("+result+")");
      $("#cityid").append("<option value='0'>请选择城市</option>");
      for(var i in response.cityinfo){
        $("#cityid").append("<option value='"+response.cityinfo[i].id+"'>" + response.cityinfo[i].citystate+ "</option>"); 
      }  
    });
   }
   else
   {alert("你没有选择哦！");}
}
  
// 列出区
function area(id){
  if(id.value != 0)
  {
    var formdata = {
      'id' : id.value
    };
    $.post('<{spUrl c=ucenter a=subclass}>', formdata, function(result){
      $('#resulttable').append(result);
      //alert(result);
      $("#areaid option").remove();
      var response = eval("("+result+")");
      $("#areaid").append("<option value='0'>请选择区</option>"); 
      for(var i in response.cityinfo){
        $("#areaid").append("<option value='"+response.cityinfo[i].id+"'>" + response.cityinfo[i].citystate+ "</option>"); 
      }  
    });
   }
   else
   {alert("你没有选择哦！");}
}

</script>
 <script>
function feedback(result,id){
  if(result != 'false')
  {
    $('.badge').removeClass('badge badge-info').text('');
    var response = eval("("+result+")");
    for(var i in response){
      $('#' + i).next().addClass('badge badge-info');
      $('#' + i).next().text(response[i].toString());
      $('.tgreen').css("display","none");
      //console.log(response[i].toString());
    }
    //$('.badge').text('sdfsd');
  }
  else
  {
    if(id == '')
    {alert('添加成功!!');window.location.reload();}
    else if(id == 'reg')
    {alert('注册成功!!');window.location.href="login.html"}
    else
    {alert('修改成功!!');window.location.reload(); }
  }
}
</script> <!--ajax 掉数据需要处理-->
<{include file="footer.html"}>